package com.hgw.Demo03_InterpreterPattern.examples;

/**
 * Data time:2021/12/17 19:41
 * StudentID:2019112118
 * Author:hgw
 * Description: 距离终点类，充当终结符表达式角色
 */
public class DistanceNode extends AbstractNode{
    private String distance;

    public DistanceNode(String distance) {
        this.distance = distance;
    }

    // 距离表达式的解释操作
    @Override
    public String interpret() {
        return this.distance;
    }
}
